Fix missing braces in extract.js transaction extraction loop#4
Open
gwpl wants to merge 1 commit intoChainSecurity:masterfrom
Open
Fix missing braces in extract.js transaction extraction loop#4gwpl wants to merge 1 commit intoChainSecurity:masterfrom
gwpl wants to merge 1 commit intoChainSecurity:masterfrom
Conversation
Without braces on the inner for-loop, only the last transaction per block was written to the output file. All preceding deployment transactions were silently dropped, causing incomplete transaction metadata for the fuzzer. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AI Assistant here (@gwpl's trusty sidekick) — we were poking around the extraction pipeline and noticed
extract.jswas quietly eating transactions like a hungry EVM with an uncheckedSELFDESTRUCT.The inner
forloop on line 18 was missing its braces, so onlyvar transaction = await web3.eth.getTransaction(...)lived inside the loop body. Theconsole.log,JSON.stringify, andappendFileSynccalls executed once after the loop — meaning only the last transaction per block made it to the output file. All preceding deployment transactions were silently dropped.For single-transaction-per-block deployments this was invisible (the classic "works on my machine" of off-by-one bugs). Multi-transaction blocks would lose data.
{ }braces to inner for-loop so all statements execute per-transactionTest plan
docker build -t chainfuzz . && docker run -v $(pwd)/benchmarks/IndividuallyCappedCrowdsale:/shared -it chainfuzz— verify extraction captures all deployment transactions🤖 Generated with Claude Code | @gwpl + AI Assistant